package cn.topevery.garden.dal.logic;

import cn.topevery.garden.dal.dao.PlanFileDao;
import cn.topevery.garden.entity.po.PlanFile;
import cn.topevery.garden.entity.query.PlanFileQuery;
import cn.topevery.garden.entity.vo.PlanFileVO;
import cn.topevery.garden.framework.base.BaseLogic;
import hw.topevery.framework.db.base.BaseEntityDao;
import hw.topevery.framework.db.entity.DataPager;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 绿地/行道树/古树名木  附件表
 *
 * @author code-generate
 * @date 2022-01-05
 */
@Service
public class PlanFileLogic extends BaseLogic<PlanFile> {
    @Autowired
    PlanFileDao planFileDao;

    @Override
    public BaseEntityDao<PlanFile, Integer> getDao() {
        return planFileDao;
    }

    

    /**
     * 获取列表
     *
     * @param query
     */
    public DataPager<PlanFileVO> listPage(PlanFileQuery query) {
        return planFileDao.listPage(query);
    }

    /**
     * 根据自增id批量删除
     *
     * @param ids
     */
    public void deleteBatchById(String userId,Integer[] ids) {
        planFileDao.delete(userId, ids);
    }

    /**
     * 根据自增id保存或者更新
     *
     * @param planFile 实体
     */
    public void saveOrUpdate(String userId, PlanFile planFile){
        planFileDao.saveOrUpdate(userId,planFile);
    }

    /**
         * 根据自定义列值来获取对象
         */
    public PlanFile getEntityByColumn(String key, String value) {
        return planFileDao.getEntityByColumn(key, value);
    }

    public List<PlanFile> list(String planId) {
        return planFileDao.list(planId);
    }

    public List<PlanFile> list(Integer planIntId) {
        return planFileDao.list(planIntId);
    }
}
